<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/*
<span class='line'>  2</span>  * $Id: om-itemselector.js,v 1.15 2012/06/18 08:43:54 wangfan Exp $
<span class='line'>  3</span>  * operamasks-ui omCombo @VERSION
<span class='line'>  4</span>  *
<span class='line'>  5</span>  * Copyright 2011, AUTHORS.txt (http://ui.operamasks.org/about)
<span class='line'>  6</span>  * Dual licensed under the MIT or LGPL Version 2 licenses.
<span class='line'>  7</span>  * http://ui.operamasks.org/license
<span class='line'>  8</span>  *
<span class='line'>  9</span>  * http://ui.operamasks.org/docs/
<span class='line'> 10</span>  *
<span class='line'> 11</span>  * Depends:
<span class='line'> 12</span>  *  om-core.js
<span class='line'> 13</span>  *  om-mouse.js
<span class='line'> 14</span>  *  om-sortable.js
<span class='line'> 15</span>  */</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="PUNC">;</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'> 18</span>      * @name omItemSelector
<span class='line'> 19</span>      * @class 左移右移组件。两个多选列表框，可以从左边将一些item移到右边，也可以从右边将一些item移到左边。&lt;br/>&lt;br/>
<span class='line'> 20</span>      * &lt;b>特点：&lt;/b>&lt;br/>
<span class='line'> 21</span>      * &lt;ol>
<span class='line'> 22</span>      *      &lt;li>可以使用本地数据源，也可以使用远程数据源&lt;/li>
<span class='line'> 23</span>      *      &lt;li>包含常用的【左移】【右移】【全部左移】【全部右移】操作&lt;/li>
<span class='line'> 24</span>      *      &lt;li>提供丰富的事件&lt;/li>
<span class='line'> 25</span>      * &lt;/ol>
<span class='line'> 26</span>      * 
<span class='line'> 27</span>      * &lt;b>示例：&lt;/b>&lt;br/>
<span class='line'> 28</span>      * &lt;pre>
<span class='line'> 29</span>      * &lt;script type="text/javascript" >
<span class='line'> 30</span>      * $(document).ready(function() {
<span class='line'> 31</span>      *     $('#itemselector').omItemSelector({
<span class='line'> 32</span>      *         dataSource:[
<span class='line'> 33</span>      *                  {text:'Java',value:'1'},
<span class='line'> 34</span>      *                  {text:'JavaScript',value:'2'},
<span class='line'> 35</span>      *                  {text:'C',value:'3'},
<span class='line'> 36</span>      *                  {text:'PHP',value:'4'},
<span class='line'> 37</span>      *                  {text:'ASP',value:'5'}
<span class='line'> 38</span>      *         ],
<span class='line'> 39</span>      *         width:250,
<span class='line'> 40</span>      *         height:200
<span class='line'> 41</span>      *     });
<span class='line'> 42</span>      * });
<span class='line'> 43</span>      * &lt;/script>
<span class='line'> 44</span>      * 
<span class='line'> 45</span>      * &lt;div id="itemselector"/>
<span class='line'> 46</span>      * &lt;/pre>
<span class='line'> 47</span>      * 
<span class='line'> 48</span>      * @constructor
<span class='line'> 49</span>      * @description 构造函数. 
<span class='line'> 50</span>      * @param p 标准config对象：{}
<span class='line'> 51</span>      */</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT">    </span><span class="NAME">$.omWidget</span><span class="PUNC">(</span><span class="STRN">'om.omItemSelector'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT">        </span><span class="NAME">options</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="COMM">/** @lends omItemSelector#*/</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT">             </span><span class="COMM">/**
<span class='line'> 55</span>               * 组件宽度。
<span class='line'> 56</span>               * @type String
<span class='line'> 57</span>               * @default '250px'
<span class='line'> 58</span>               * @example
<span class='line'> 59</span>               * width : '300px'
<span class='line'> 60</span>               */</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT">             </span><span class="NAME">width</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'300px'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT">             </span><span class="COMM">/**
<span class='line'> 63</span>               * 组件高度。
<span class='line'> 64</span>               * @type String
<span class='line'> 65</span>               * @default '200px'
<span class='line'> 66</span>               * @example
<span class='line'> 67</span>               * height : '300px'
<span class='line'> 68</span>               */</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT">            </span><span class="NAME">height</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'300px'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'> 71</span>               * 数据源属性，可以设置为“后台获取数据的URL”或者“JSON数据”
<span class='line'> 72</span>               * @type Array[JSON],URL
<span class='line'> 73</span>               * @default []
<span class='line'> 74</span>               * @example
<span class='line'> 75</span>               * dataSource : '/data/items.json' 
<span class='line'> 76</span>               * 或者
<span class='line'> 77</span>               * dataSource : [{"value":"001","text":"张三"},{"value":"002","text":"李四"}]
<span class='line'> 78</span>               * 或者下面这种(这种非标准的itemData一定要配合clientFormatter使用)
<span class='line'> 79</span>               * dataSource : [{"value":"001","name":"张三"},{"value":"002","name":"李四"}]
<span class='line'> 80</span>               */</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT">            </span><span class="NAME">dataSource</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'> 83</span>               * 初始值。如dataSource:[{text:'abc',value:1},{text:'def',value:2},{text:'xyz',value:3}]且value:[2]，则左边显示1、3两条，右边显示第2条。
<span class='line'> 84</span>               * @type Array[JSON]
<span class='line'> 85</span>               * @default []
<span class='line'> 86</span>               * @example
<span class='line'> 87</span>               * value : [1,3]
<span class='line'> 88</span>               */</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT">            </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'> 91</span>               * 每个dataSource中每个item如何显示到列表中。默认仅显示item数据的text属性值。
<span class='line'> 92</span>               * @type Function
<span class='line'> 93</span>               * @default 无
<span class='line'> 94</span>               * @example
<span class='line'> 95</span>               * //对于{text:'中国',value:'zh_CN'}将显示成'中国(zh_CN)'这样
<span class='line'> 96</span>               * clientFormatter  : function(itemData,index){
<span class='line'> 97</span>               *     return itemData.text+'('+itemData.value)+')';//返回一段html代码
<span class='line'> 98</span>               * }
<span class='line'> 99</span>               * 
<span class='line'>100</span>               * //对于{name:'张三',role:'经理',value:'PM'}将显示成红色的'张三(经理)'这样
<span class='line'>101</span>               * //对于{name:'李四',role:'普通员工',value:'EMP'}将显示成黑色的'李四'这样
<span class='line'>102</span>               * clientFormatter  : function(itemData,index){
<span class='line'>103</span>               *     if(itemData.role=='经理'){
<span class='line'>104</span>               *         return '&lt;font color="red">'+itemData.name+'('+itemData.value)+')&lt;/font>';
<span class='line'>105</span>               *     }else{
<span class='line'>106</span>               *         return itemData.name;
<span class='line'>107</span>               *     }
<span class='line'>108</span>               * }
<span class='line'>109</span>               */</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT">            </span><span class="NAME">clientFormatter</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>112</span>               * 左边可选项的标题。
<span class='line'>113</span>               * @name omItemSelector#availableTitle
<span class='line'>114</span>               * @type String
<span class='line'>115</span>               * @default '可选项'
<span class='line'>116</span>               * @example
<span class='line'>117</span>               * availableTitle : '可加入的用户组'
<span class='line'>118</span>               */</span><span class="WHIT">
<span class='line'>119</span> </span><span class="WHIT">            </span><span class="COMM">//availableTitle : $.om.lang.omItemSelector.availableTitle,</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>121</span>               * 右边已选项的标题。
<span class='line'>122</span>               * @name omItemSelector#selectedTitle
<span class='line'>123</span>               * @type String
<span class='line'>124</span>               * @default '已选项'
<span class='line'>125</span>               * @example
<span class='line'>126</span>               * selectedTitle : '已加入的用户组'
<span class='line'>127</span>               */</span><span class="WHIT">
<span class='line'>128</span> </span><span class="WHIT">            </span><span class="COMM">//selectedTitle : $.om.lang.omItemSelector.selectedTitle,</span><span class="WHIT">
<span class='line'>129</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>130</span>               * 是否自动排序。设为true后每次将item左移或右移时将会对item进行排序（按照dataSource中数据源的顺序）。&lt;b>注意：启用此功能后将无法使用拖动排序功能，也不会显示【上移】【下移】【置顶】【置底】这几个按钮。&lt;/b>
<span class='line'>131</span>               * @type Boolean
<span class='line'>132</span>               * @default false
<span class='line'>133</span>               * @example
<span class='line'>134</span>               * autoSort : true
<span class='line'>135</span>               */</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT">            </span><span class="NAME">autoSort</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>138</span>               * 给Ajax返回的原始数据的进行预处理的函数。其中参数data是服务器返回的数据。
<span class='line'>139</span>               * @type Function
<span class='line'>140</span>               * @field
<span class='line'>141</span>               * @default 无
<span class='line'>142</span>               * @example
<span class='line'>143</span>               * preProcess  : function(data){
<span class='line'>144</span>               *     return data;//这里返回处理后的数据
<span class='line'>145</span>               * }
<span class='line'>146</span>               */</span><span class="WHIT">
<span class='line'>147</span> </span><span class="WHIT">            </span><span class="NAME">preProcess</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>148</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>149</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>150</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>151</span>              * 以Ajax方式加载数据出错时的回调函数。可以在这里进行一些处理，比如以人性化的方式提示用户。
<span class='line'>152</span>              * @event
<span class='line'>153</span>              * @param xmlHttpRequest XMLHttpRequest对象
<span class='line'>154</span>              * @param textStatus  错误类型
<span class='line'>155</span>              * @param errorThrown  捕获的异常对象
<span class='line'>156</span>              * @param event jQuery.Event对象
<span class='line'>157</span>              * @type Function
<span class='line'>158</span>              * @example
<span class='line'>159</span>              * onError:function(xmlHttpRequest, textStatus, errorThrown,event){ 
<span class='line'>160</span>              *      alert('取数出错');
<span class='line'>161</span>              *  } 
<span class='line'>162</span>              */</span><span class="WHIT">
<span class='line'>163</span> </span><span class="WHIT">            </span><span class="NAME">onError</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">jQuery.noop</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>164</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>165</span>              * 以Ajax方式加载数据成功时的回调函数。此方法在渲染可选项item之前执行。
<span class='line'>166</span>              * @event
<span class='line'>167</span>              * @param data Ajax请求返回的数据
<span class='line'>168</span>              * @param textStatus 响应的状态
<span class='line'>169</span>              * @param event jQuery.Event对象
<span class='line'>170</span>              * @type Function
<span class='line'>171</span>              * @example
<span class='line'>172</span>              * onSuccess:function(data, textStatus, event){
<span class='line'>173</span>              *     if(data.length==0){
<span class='line'>174</span>              *          alert('没有数据！');
<span class='line'>175</span>              *     } 
<span class='line'>176</span>              * }
<span class='line'>177</span>              */</span><span class="WHIT">
<span class='line'>178</span> </span><span class="WHIT">            </span><span class="NAME">onSuccess</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">jQuery.noop</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>179</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>180</span>              * 从左边将item移到右边之前执行的动作。如果返回false，则item不会进行移动。用户可以在这个事件中进行一些其它有用的处理，比如监听此方法然后return selectedItems.length &lt; 3就能实现“最多只能选择3个item”的功能
<span class='line'>181</span>              * @event
<span class='line'>182</span>              * @param itemDatas 正在移动的item对应的数据组成的数组，比如dataSource是[{text:'A',value:0},{text:'B',value:1}]，则移动A时itemDatas是[{text:'A',value:0}]；移动B时itemDatas是[{text:'B',value:1}]，同时移动A、B时itemDatas是[{text:'A',value:0},{text:'B',value:1}]
<span class='line'>183</span>              * @param event jQuery.Event对象
<span class='line'>184</span>              * @type Function
<span class='line'>185</span>              * @example
<span class='line'>186</span>              * onBeforeItemSelect:function(itemDatas,event){
<span class='line'>187</span>              *     alert('即将加入到:'+itemDatas.length+'个群中');
<span class='line'>188</span>              * }
<span class='line'>189</span>              */</span><span class="WHIT">
<span class='line'>190</span> </span><span class="WHIT">            </span><span class="NAME">onBeforeItemSelect</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">jQuery.noop</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>192</span>              * 从右边将item移到左边之前执行的动作。如果返回false，则item不会进行移动。用户可以在这个事件中进行一些其它有用的处理，比如能实现“员工是基本角色，不可以退出该角色”的功能
<span class='line'>193</span>              * @event
<span class='line'>194</span>              * @param itemDatas 正在移动的item对应的数据组成的数组，比如dataSource是[{text:'A',value:0},{text:'B',value:1}]，则移动A时itemDatas是[{text:'A',value:0}]；移动B时itemDatas是[{text:'B',value:1}]，同时移动A、B时itemDatas是[{text:'A',value:0},{text:'B',value:1}]
<span class='line'>195</span>              * @param event jQuery.Event对象
<span class='line'>196</span>              * @type Function
<span class='line'>197</span>              * @example
<span class='line'>198</span>              * onBeforeItemDeselect:function(itemDatas,event){
<span class='line'>199</span>              *     $.each(itemDatas,function(index,data){
<span class='line'>200</span>              *         if(data.text=='员工'){
<span class='line'>201</span>              *             alert('员工是基本角色，不可以退出该角色！');
<span class='line'>202</span>              *             return false;
<span class='line'>203</span>              *         } 
<span class='line'>204</span>              *     });
<span class='line'>205</span>              * }
<span class='line'>206</span>              */</span><span class="WHIT">
<span class='line'>207</span> </span><span class="WHIT">            </span><span class="NAME">onBeforeItemDeselect</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">jQuery.noop</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>208</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>209</span>              * 从左边将item移到右边之后执行的动作。
<span class='line'>210</span>              * @event
<span class='line'>211</span>              * @param itemDatas 正在移动的item对应的数据组成的数组，比如dataSource是[{text:'A',value:0},{text:'B',value:1}]，则移动A时itemDatas是[{text:'A',value:0}]；移动B时itemDatas是[{text:'B',value:1}]，同时移动A、B时itemDatas是[{text:'A',value:0},{text:'B',value:1}]
<span class='line'>212</span>              * @param event jQuery.Event对象
<span class='line'>213</span>              * @type Function
<span class='line'>214</span>              * @example
<span class='line'>215</span>              * onItemSelect:function(itemDatas,event){
<span class='line'>216</span>              *      alert('你刚刚选择了'+itemDatas.length+'个条目');
<span class='line'>217</span>              * }
<span class='line'>218</span>              */</span><span class="WHIT">
<span class='line'>219</span> </span><span class="WHIT">            </span><span class="NAME">onItemSelect</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">jQuery.noop</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>220</span> </span><span class="WHIT">            </span><span class="COMM">/**
<span class='line'>221</span>              * 从右边将item移到左边之后执行的动作。
<span class='line'>222</span>              * @event
<span class='line'>223</span>              * @param itemDatas 正在移动的item对应的数据组成的数组，比如dataSource是[{text:'A',value:0},{text:'B',value:1}]，则移动A时itemDatas是[{text:'A',value:0}]；移动B时itemDatas是[{text:'B',value:1}]，同时移动A、B时itemDatas是[{text:'A',value:0},{text:'B',value:1}]
<span class='line'>224</span>              * @param event jQuery.Event对象
<span class='line'>225</span>              * @type Function
<span class='line'>226</span>              * @example
<span class='line'>227</span>              * onItemDeselect :function(itemDatas,event){
<span class='line'>228</span>              *      alert('你刚刚去掉了'+itemDatas.length+'个条目');
<span class='line'>229</span>              * }
<span class='line'>230</span>              */</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT">            </span><span class="NAME">onItemDeselect</span><span class="WHIT">  </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">jQuery.noop</span><span class="WHIT">
<span class='line'>232</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>233</span> </span><span class="WHIT">        </span><span class="NAME">_create</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>234</span> </span><span class="WHIT">            </span><span class="NAME">this.element.addClass</span><span class="PUNC">(</span><span class="STRN">'om-itemselector om-widget'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">html</span><span class="PUNC">(</span><span class="STRN">'&lt;table style="height:100%;width:100%" cellpadding="0" cellspacing="0">&lt;tr>&lt;td class="om-itemselector-leftpanel">&lt;/td>&lt;td class="om-itemselector-toolbar">&lt;/td>&lt;td class="om-itemselector-rightpanel">&lt;/td>&lt;/tr>&lt;/table>'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>235</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tds</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'td'</span><span class="PUNC">,</span><span class="NAME">this.element</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>236</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">thead</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;thead>&lt;/thead>'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>237</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">cell</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;th>&lt;/th>'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">axis</span><span class="PUNC">:</span><span class="STRN">'checkboxCol'</span><span class="PUNC">,</span><span class="NAME">align</span><span class="PUNC">:</span><span class="STRN">'center'</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>238</span> </span><span class="WHIT">            </span><span class="PUNC">.</span><span class="NAME">append</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;div class="header">&lt;span class="checkbox"/>&lt;span class="om-itemselector-title"/>&lt;/div>'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>239</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;tr>&lt;/tr>'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">append</span><span class="PUNC">(</span><span class="NAME">cell</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">appendTo</span><span class="PUNC">(</span><span class="NAME">thead</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>240</span> </span><span class="WHIT">            </span><span class="NAME">this.leftPanel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;table cellspacing="0" cellpadding="0">&lt;/table>'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">append</span><span class="PUNC">(</span><span class="NAME">thead</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>241</span> </span><span class="WHIT">            </span><span class="PUNC">.</span><span class="NAME">append</span><span class="PUNC">(</span><span class="STRN">'&lt;tr>&lt;td>&lt;div class="om-itemselector-up">&lt;span class="upbtn"/>&lt;/div>&lt;div class="om-itemselector-items">&lt;dl>&lt;/dl>&lt;/div>&lt;div class="om-itemselector-down">&lt;span class="downbtn"/>&lt;/div>&lt;/tr>&lt;/td>'</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>242</span> </span><span class="WHIT">            </span><span class="PUNC">.</span><span class="NAME">appendTo</span><span class="PUNC">(</span><span class="NAME">tds.eq</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>243</span> </span><span class="WHIT">            </span><span class="NAME">this.toolbar</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;div>&lt;/div>'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">appendTo</span><span class="PUNC">(</span><span class="NAME">tds.eq</span><span class="PUNC">(</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>244</span> </span><span class="WHIT">            </span><span class="NAME">this.rightPanel</span><span class="PUNC">=</span><span class="NAME">this.leftPanel.clone</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">appendTo</span><span class="PUNC">(</span><span class="NAME">tds.eq</span><span class="PUNC">(</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>245</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>246</span> </span><span class="WHIT">        </span><span class="NAME">_init</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>247</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">op</span><span class="PUNC">=</span><span class="NAME">this.options</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>248</span> </span><span class="WHIT">                </span><span class="NAME">dataSource</span><span class="PUNC">=</span><span class="NAME">op.dataSource</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>249</span> </span><span class="WHIT">            </span><span class="NAME">this.leftPanel.find</span><span class="PUNC">(</span><span class="STRN">".om-itemselector-title"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">html</span><span class="PUNC">(</span><span class="NAME">$.om.lang._get</span><span class="PUNC">(</span><span class="NAME">op</span><span class="PUNC">,</span><span class="STRN">"omItemSelector"</span><span class="PUNC">,</span><span class="STRN">"availableTitle"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>250</span> </span><span class="WHIT">            </span><span class="NAME">this.rightPanel.find</span><span class="PUNC">(</span><span class="STRN">".om-itemselector-title"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">html</span><span class="PUNC">(</span><span class="NAME">$.om.lang._get</span><span class="PUNC">(</span><span class="NAME">op</span><span class="PUNC">,</span><span class="STRN">"omItemSelector"</span><span class="PUNC">,</span><span class="STRN">"selectedTitle"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>251</span> </span><span class="WHIT">            </span><span class="NAME">this.element.css</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">width</span><span class="PUNC">:</span><span class="NAME">op.width</span><span class="PUNC">,</span><span class="NAME">height</span><span class="PUNC">:</span><span class="NAME">op.height</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>252</span> </span><span class="WHIT">            </span><span class="NAME">this._buildToolbar</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>253</span> </span><span class="WHIT">            </span><span class="NAME">this._resizePanel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="COMM">//调整左右fieldset大小</span><span class="WHIT">
<span class='line'>254</span> </span><span class="WHIT">            </span><span class="NAME">this._bindEvents</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>255</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">dataSource</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>256</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">=</span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>257</span> </span><span class="WHIT">                </span><span class="NAME">$.ajax</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>258</span> </span><span class="WHIT">                    </span><span class="NAME">url</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">dataSource</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>259</span> </span><span class="WHIT">                    </span><span class="NAME">method</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'GET'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>260</span> </span><span class="WHIT">                    </span><span class="NAME">dataType</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'json'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>261</span> </span><span class="WHIT">                    </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">textStatus</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>262</span> </span><span class="WHIT">                        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">self._trigger</span><span class="PUNC">(</span><span class="STRN">"onSuccess"</span><span class="PUNC">,</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="NAME">data</span><span class="PUNC">,</span><span class="NAME">textStatus</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>263</span> </span><span class="WHIT">                            </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>264</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>265</span> </span><span class="WHIT">                        </span><span class="NAME">data</span><span class="PUNC">=</span><span class="NAME">op.preProcess</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>266</span> </span><span class="WHIT">                        </span><span class="NAME">op.dataSource</span><span class="PUNC">=</span><span class="NAME">data</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>267</span> </span><span class="WHIT">                        </span><span class="NAME">self._buildList</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>268</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>269</span> </span><span class="WHIT">                    </span><span class="NAME">error</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">XMLHttpRequest</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">textStatus</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">errorThrown</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>270</span> </span><span class="WHIT">                    	</span><span class="NAME">self._trigger</span><span class="PUNC">(</span><span class="STRN">"onError"</span><span class="PUNC">,</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="NAME">XMLHttpRequest</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">textStatus</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">errorThrown</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>271</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>272</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>273</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>274</span> </span><span class="WHIT">                </span><span class="NAME">this._buildList</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>275</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>276</span> </span><span class="WHIT">             
<span class='line'>277</span>             </span><span class="NAME">this._refreshPageButton</span><span class="PUNC">(</span><span class="NAME">this.leftPanel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>278</span> </span><span class="WHIT">            </span><span class="NAME">this._refreshPageButton</span><span class="PUNC">(</span><span class="NAME">this.rightPanel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>279</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>280</span> </span><span class="WHIT">        </span><span class="NAME">_buildToolbar</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>281</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">html</span><span class="PUNC">=</span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>282</span> </span><span class="WHIT">                </span><span class="NAME">ALL_ICONS</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="STRN">'add'</span><span class="PUNC">,</span><span class="STRN">'space'</span><span class="PUNC">,</span><span class="STRN">'remove'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>283</span> </span><span class="WHIT">            </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">len</span><span class="PUNC">=</span><span class="NAME">ALL_ICONS.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>284</span> </span><span class="WHIT">            	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">=</span><span class="NAME">ALL_ICONS</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT">                </span><span class="NAME">html</span><span class="PUNC">+</span><span class="PUNC">=</span><span class="STRN">'&lt;div class="om-icon om-itemselector-tbar-'</span><span class="PUNC">+</span><span class="NAME">icon</span><span class="PUNC">+</span><span class="STRN">'"'</span><span class="PUNC">+</span><span class="STRN">' title="'</span><span class="PUNC">+</span><span class="PUNC">(</span><span class="NAME">$.om.lang._get</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="STRN">"omItemSelector"</span><span class="PUNC">,</span><span class="NAME">icon</span><span class="PUNC">+</span><span class="STRN">'IconTip'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">+</span><span class="STRN">'">&lt;/div>'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>287</span> </span><span class="WHIT">            </span><span class="NAME">this.toolbar.html</span><span class="PUNC">(</span><span class="NAME">html</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>288</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>289</span> </span><span class="WHIT">        </span><span class="NAME">_resizePanel</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>290</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">lp</span><span class="PUNC">=</span><span class="NAME">self.leftPanel</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>291</span> </span><span class="WHIT">                </span><span class="NAME">rp</span><span class="PUNC">=</span><span class="NAME">self.rightPanel</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>292</span> </span><span class="WHIT">                </span><span class="NAME">leftItemsContainer</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items'</span><span class="PUNC">,</span><span class="NAME">lp</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>293</span> </span><span class="WHIT">                </span><span class="NAME">rightItemsContainer</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items'</span><span class="PUNC">,</span><span class="NAME">rp</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>294</span> </span><span class="WHIT">                </span><span class="NAME">H</span><span class="PUNC">=</span><span class="NAME">lp.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">innerHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">-</span><span class="NAME">leftItemsContainer.offset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">top</span><span class="PUNC">+</span><span class="NAME">lp.offset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">top</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>295</span> </span><span class="WHIT">                </span><span class="NAME">W</span><span class="PUNC">=</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'tr'</span><span class="PUNC">,</span><span class="NAME">self.element</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">innerWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">-</span><span class="NAME">self.toolbar.outerWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">/</span><span class="NUMB">2</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>296</span> </span><span class="WHIT">                </span><span class="NAME">innerW</span><span class="PUNC">=</span><span class="NAME">lp.outerWidth</span><span class="PUNC">(</span><span class="NAME">W</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">innerWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>297</span> </span><span class="WHIT">            </span><span class="NAME">leftItemsContainer.outerHeight</span><span class="PUNC">(</span><span class="NAME">H</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">width</span><span class="PUNC">(</span><span class="NAME">innerW</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>298</span> </span><span class="WHIT">            </span><span class="NAME">rightItemsContainer.outerHeight</span><span class="PUNC">(</span><span class="NAME">H</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">width</span><span class="PUNC">(</span><span class="NAME">innerW</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>299</span> </span><span class="WHIT">            </span><span class="NAME">self.element.data</span><span class="PUNC">(</span><span class="STRN">"dltop"</span><span class="PUNC">,</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items >dl'</span><span class="PUNC">,</span><span class="NAME">lp</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">offset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">top</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>300</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>301</span> </span><span class="WHIT">        </span><span class="NAME">_buildList</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>302</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">op</span><span class="PUNC">=</span><span class="NAME">this.options</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>303</span> </span><span class="WHIT">                </span><span class="NAME">dataSource</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">op.dataSource</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>304</span> </span><span class="WHIT">                </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">op.value</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>305</span> </span><span class="WHIT">                </span><span class="NAME">fmt</span><span class="PUNC">=</span><span class="NAME">op.clientFormatter</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>306</span> </span><span class="WHIT">                </span><span class="NAME">leftHtml</span><span class="PUNC">=</span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>307</span> </span><span class="WHIT">                </span><span class="NAME">rightHtml</span><span class="PUNC">=</span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>308</span> </span><span class="WHIT">                </span><span class="COMM">// {text:'abc',value:2}的value是否在value:[0,2,4]这样的数组中</span><span class="WHIT">
<span class='line'>309</span> </span><span class="WHIT">                </span><span class="NAME">inArray</span><span class="PUNC">=</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">,</span><span class="NAME">valueArr</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>310</span> </span><span class="WHIT">                    </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">len</span><span class="PUNC">=</span><span class="NAME">valueArr.length</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">len</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>311</span> </span><span class="WHIT">                        </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">data.value</span><span class="PUNC">===</span><span class="NAME">valueArr</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>312</span> </span><span class="WHIT">                            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>313</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>314</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>315</span> </span><span class="WHIT">                    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>316</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>317</span> </span><span class="WHIT">                </span><span class="NAME">buildHtml</span><span class="PUNC">=</span><span class="NAME">fmt</span><span class="PUNC">?</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">,</span><span class="NAME">data</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>318</span> </span><span class="WHIT">                    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'&lt;dt _index="'</span><span class="PUNC">+</span><span class="NAME">index</span><span class="PUNC">+</span><span class="STRN">'">'</span><span class="PUNC">+</span><span class="STRN">'&lt;span class="checkbox"/>'</span><span class="PUNC">+</span><span class="NAME">fmt</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">,</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">+</span><span class="STRN">'&lt;/dt>'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>319</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">,</span><span class="NAME">data</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>320</span> </span><span class="WHIT">                    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'&lt;dt _index="'</span><span class="PUNC">+</span><span class="NAME">index</span><span class="PUNC">+</span><span class="STRN">'">'</span><span class="PUNC">+</span><span class="STRN">'&lt;span class="checkbox"/>'</span><span class="PUNC">+</span><span class="NAME">data.text</span><span class="PUNC">+</span><span class="STRN">'&lt;/dt>'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>321</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>322</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$.isArray</span><span class="PUNC">(</span><span class="NAME">dataSource</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">jQuery.isArray</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>323</span> </span><span class="WHIT">                </span><span class="NAME">$.each</span><span class="PUNC">(</span><span class="NAME">dataSource</span><span class="PUNC">,</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">,</span><span class="NAME">data</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>324</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">inArray</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">,</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="COMM">//在value中，要放到右边</span><span class="WHIT">
<span class='line'>325</span> </span><span class="WHIT">                        </span><span class="NAME">rightHtml</span><span class="PUNC">+</span><span class="PUNC">=</span><span class="NAME">buildHtml</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">,</span><span class="NAME">data</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>326</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="COMM">//不在value中,放到左边</span><span class="WHIT">
<span class='line'>327</span> </span><span class="WHIT">                        </span><span class="NAME">leftHtml</span><span class="PUNC">+</span><span class="PUNC">=</span><span class="NAME">buildHtml</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">,</span><span class="NAME">data</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>328</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>329</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>330</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>331</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items>dl'</span><span class="PUNC">,</span><span class="NAME">this.leftPanel</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">html</span><span class="PUNC">(</span><span class="NAME">leftHtml</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>332</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items>dl'</span><span class="PUNC">,</span><span class="NAME">this.rightPanel</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">html</span><span class="PUNC">(</span><span class="NAME">rightHtml</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>333</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">items</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">itemdtH</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'>dl>dt'</span><span class="PUNC">,</span><span class="NAME">items</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">outerHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>334</span> </span><span class="WHIT">            </span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="NAME">items.outerHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">offset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">itemdtH</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">h</span><span class="PUNC">%</span><span class="NAME">itemdtH</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>335</span> </span><span class="WHIT">            </span><span class="NAME">items.outerHeight</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">+</span><span class="NAME">offset</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">           
<span class='line'>336</span>         </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>337</span> </span><span class="WHIT">        </span><span class="NAME">_bindEvents</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>338</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">=</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>339</span> </span><span class="WHIT">                </span><span class="NAME">toolbar</span><span class="PUNC">=</span><span class="NAME">self.toolbar</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>340</span> </span><span class="WHIT">            </span><span class="COMM">//单击</span><span class="WHIT">
<span class='line'>341</span> </span><span class="WHIT">            </span><span class="NAME">self.leftPanel.delegate</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items>dl>dt'</span><span class="PUNC">,</span><span class="STRN">'click.omItemSelector'</span><span class="PUNC">,</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>342</span> </span><span class="WHIT">            	</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">toggleClass</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="STRN">'om-state-highlight'</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>343</span> </span><span class="WHIT">            	</span><span class="NAME">self._refreshHeaderCheckbox</span><span class="PUNC">(</span><span class="NAME">self.leftPanel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>344</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>345</span> </span><span class="WHIT">            </span><span class="NAME">self.rightPanel.delegate</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items>dl>dt'</span><span class="PUNC">,</span><span class="STRN">'click'</span><span class="PUNC">,</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>346</span> </span><span class="WHIT">            	</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">toggleClass</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="STRN">'om-state-highlight'</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>347</span> </span><span class="WHIT">            	</span><span class="NAME">self._refreshHeaderCheckbox</span><span class="PUNC">(</span><span class="NAME">self.rightPanel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>348</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>349</span> </span><span class="WHIT">            </span><span class="COMM">//双击</span><span class="WHIT">
<span class='line'>350</span> </span><span class="WHIT">            </span><span class="NAME">this.leftPanel.delegate</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items>dl>dt'</span><span class="PUNC">,</span><span class="STRN">'dblclick'</span><span class="PUNC">,</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>351</span> </span><span class="WHIT">            	</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items>dl>dt'</span><span class="PUNC">,</span><span class="NAME">self.element</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">'om-state-highlight'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>352</span> </span><span class="WHIT">            	</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">'om-state-highlight'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>353</span> </span><span class="WHIT">            	</span><span class="NAME">self._moveItemsToTarget</span><span class="PUNC">(</span><span class="STRN">'.om-state-highlight'</span><span class="PUNC">,</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>354</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>355</span> </span><span class="WHIT">            </span><span class="NAME">this.rightPanel.delegate</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items>dl>dt'</span><span class="PUNC">,</span><span class="STRN">'dblclick'</span><span class="PUNC">,</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>356</span> </span><span class="WHIT">            	</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items>dl>dt'</span><span class="PUNC">,</span><span class="NAME">self.element</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">'om-state-highlight'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>357</span> </span><span class="WHIT">            	</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">'om-state-highlight'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>358</span> </span><span class="WHIT">                </span><span class="NAME">self._moveItemsToTarget</span><span class="PUNC">(</span><span class="STRN">'.om-state-highlight'</span><span class="PUNC">,</span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>359</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>360</span> </span><span class="WHIT">            </span><span class="COMM">//右移</span><span class="WHIT">
<span class='line'>361</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-tbar-add'</span><span class="PUNC">,</span><span class="NAME">toolbar</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">click</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>362</span> </span><span class="WHIT">                </span><span class="NAME">self._moveItemsToTarget</span><span class="PUNC">(</span><span class="STRN">'.om-state-highlight'</span><span class="PUNC">,</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>363</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>364</span> </span><span class="WHIT">            </span><span class="COMM">//左移</span><span class="WHIT">
<span class='line'>365</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-tbar-remove'</span><span class="PUNC">,</span><span class="NAME">toolbar</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">click</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>366</span> </span><span class="WHIT">                </span><span class="NAME">self._moveItemsToTarget</span><span class="PUNC">(</span><span class="STRN">'.om-state-highlight'</span><span class="PUNC">,</span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>367</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>368</span> </span><span class="WHIT">            </span><span class="COMM">//全选</span><span class="WHIT">
<span class='line'>369</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.header span.checkbox'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">self.leftPanel</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">click</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>370</span> </span><span class="WHIT">            	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">panel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.leftPanel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$dt</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items>dl>dt'</span><span class="PUNC">,</span><span class="NAME">panel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>371</span> </span><span class="WHIT">            	</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">toggleClass</span><span class="PUNC">(</span><span class="STRN">"selected"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>372</span> </span><span class="WHIT">            	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'div.om-itemselector-up:visible'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">panel</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>373</span> </span><span class="WHIT">            		</span><span class="NAME">$dt</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">self._getPageItems</span><span class="PUNC">(</span><span class="NAME">panel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$dt</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>374</span> </span><span class="WHIT">            	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>375</span> </span><span class="WHIT">            	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">hasClass</span><span class="PUNC">(</span><span class="STRN">"selected"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>376</span> </span><span class="WHIT">            		</span><span class="NAME">$dt.addClass</span><span class="PUNC">(</span><span class="STRN">"om-state-highlight"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>377</span> </span><span class="WHIT">            	</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>378</span> </span><span class="WHIT">            		</span><span class="NAME">$dt.removeClass</span><span class="PUNC">(</span><span class="STRN">"om-state-highlight"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>379</span> </span><span class="WHIT">            	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>380</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>381</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.header span.checkbox'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">self.rightPanel</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">click</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>382</span> </span><span class="WHIT">            	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">panel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.rightPanel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$dt</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items>dl>dt'</span><span class="PUNC">,</span><span class="NAME">panel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>383</span> </span><span class="WHIT">            	</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">toggleClass</span><span class="PUNC">(</span><span class="STRN">"selected"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>384</span> </span><span class="WHIT">            	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'div.om-itemselector-up:visible'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">panel</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>385</span> </span><span class="WHIT">            		</span><span class="NAME">$dt</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">self._getPageItems</span><span class="PUNC">(</span><span class="NAME">panel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$dt</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>386</span> </span><span class="WHIT">            	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>387</span> </span><span class="WHIT">            	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">hasClass</span><span class="PUNC">(</span><span class="STRN">"selected"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>388</span> </span><span class="WHIT">            		</span><span class="NAME">$dt.addClass</span><span class="PUNC">(</span><span class="STRN">"om-state-highlight"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>389</span> </span><span class="WHIT">            	</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>390</span> </span><span class="WHIT">            		</span><span class="NAME">$dt.removeClass</span><span class="PUNC">(</span><span class="STRN">"om-state-highlight"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>391</span> </span><span class="WHIT">            	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>392</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>393</span> </span><span class="WHIT">            </span><span class="COMM">//翻页</span><span class="WHIT">
<span class='line'>394</span> </span><span class="WHIT">            </span><span class="NAME">self.element.delegate</span><span class="PUNC">(</span><span class="STRN">'div.om-itemselector-up:not([disabled])'</span><span class="PUNC">,</span><span class="STRN">'click'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>395</span> </span><span class="WHIT">            	</span><span class="NAME">self._page</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>396</span> </span><span class="WHIT">            	</span><span class="NAME">self._refreshHeaderCheckbox</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">parentsUntil</span><span class="PUNC">(</span><span class="STRN">'table'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">last</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>397</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>398</span> </span><span class="WHIT">            </span><span class="NAME">self.element.delegate</span><span class="PUNC">(</span><span class="STRN">'div.om-itemselector-down:not([disabled])'</span><span class="PUNC">,</span><span class="STRN">'click'</span><span class="PUNC">,</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>399</span> </span><span class="WHIT">            	</span><span class="NAME">self._page</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>400</span> </span><span class="WHIT">            	</span><span class="NAME">self._refreshHeaderCheckbox</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">parentsUntil</span><span class="PUNC">(</span><span class="STRN">'table'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">last</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>401</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>402</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>403</span> </span><span class="WHIT">        </span><span class="NAME">_page</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">btn</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">isup</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>404</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$items</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">isup</span><span class="PUNC">?</span><span class="NAME">btn.next</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">:</span><span class="NAME">btn.prev</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>405</span> </span><span class="WHIT">        	</span><span class="NAME">$dl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$items.children</span><span class="PUNC">(</span><span class="STRN">"dl"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">h</span><span class="PUNC">=</span><span class="NAME">$items.outerHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">-</span><span class="NUMB">2</span><span class="PUNC">,</span><span class="NAME">dlH</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$dl.outerHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>406</span> </span><span class="WHIT">        	</span><span class="NAME">dltop</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="NAME">$dl.offset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">top</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nextbtn</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">top</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.element.data</span><span class="PUNC">(</span><span class="STRN">"dltop"</span><span class="PUNC">)</span><span class="PUNC">+</span><span class="NUMB">20</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>407</span> </span><span class="WHIT">        	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">isup</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>408</span> </span><span class="WHIT">        		</span><span class="NAME">$dl.offset</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">top</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">dltop</span><span class="PUNC">+</span><span class="NAME">h</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>409</span> </span><span class="WHIT">        		</span><span class="NAME">nextbtn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$items.next</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>410</span> </span><span class="WHIT">        		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">dltop</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="NAME">$dl.offset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">top</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">></span><span class="NUMB">0</span><span class="PUNC">||</span><span class="PUNC">(</span><span class="NAME">$dl.outerHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">dltop</span><span class="PUNC">-</span><span class="NAME">top</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">></span><span class="NAME">h</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>411</span> </span><span class="WHIT">        			</span><span class="NAME">nextbtn.removeAttr</span><span class="PUNC">(</span><span class="STRN">"disabled"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">"om-itemselector-down-disabled"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>412</span> </span><span class="WHIT">        		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>413</span> </span><span class="WHIT">        		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">dltop</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">dltop</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">h</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>414</span> </span><span class="WHIT">        			</span><span class="NAME">btn.attr</span><span class="PUNC">(</span><span class="STRN">"disabled"</span><span class="PUNC">,</span><span class="STRN">"disabled"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">"om-itemselector-up-disabled"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>415</span> </span><span class="WHIT">        		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>416</span> </span><span class="WHIT">        	</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>417</span> </span><span class="WHIT">        		</span><span class="NAME">$dl.offset</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">top</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">dltop</span><span class="PUNC">-</span><span class="NAME">h</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>418</span> </span><span class="WHIT">        		</span><span class="NAME">nextbtn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$items.prev</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>419</span> </span><span class="WHIT">            	</span><span class="NAME">nextbtn.removeAttr</span><span class="PUNC">(</span><span class="STRN">"disabled"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">"om-itemselector-up-disabled"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>420</span> </span><span class="WHIT">            	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">dltop</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="NAME">$dl.offset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">top</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">dlH</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">dltop</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">top</span><span class="PUNC">)</span><span class="PUNC">&lt;=</span><span class="NAME">h</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>421</span> </span><span class="WHIT">            		</span><span class="NAME">btn.attr</span><span class="PUNC">(</span><span class="STRN">"disabled"</span><span class="PUNC">,</span><span class="STRN">"disabled"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">"om-itemselector-down-disabled"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>422</span> </span><span class="WHIT">            	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>423</span> </span><span class="WHIT">        	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>424</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>425</span> </span><span class="WHIT">        </span><span class="NAME">_refreshHeaderCheckbox</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">panel</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>426</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$dt</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items>dl>dt'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">panel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>427</span> </span><span class="WHIT">        	</span><span class="NAME">$dt</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">this._getPageItems</span><span class="PUNC">(</span><span class="NAME">panel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$dt</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>428</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">selects</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$dt.filter</span><span class="PUNC">(</span><span class="STRN">'.om-state-highlight'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>429</span> </span><span class="WHIT">        	</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.header span.checkbox'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">panel</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">toggleClass</span><span class="PUNC">(</span><span class="STRN">"selected"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">selects</span><span class="PUNC">></span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">$dt.length</span><span class="PUNC">===</span><span class="NAME">selects</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>430</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>431</span> </span><span class="WHIT">        </span><span class="NAME">_refreshPageButton</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">panel</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>432</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$items</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items'</span><span class="PUNC">,</span><span class="NAME">panel</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$dl</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items >dl'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">panel</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>433</span> </span><span class="WHIT">            </span><span class="NAME">$up</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-up'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">panel</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$down</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-down'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">panel</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>434</span> </span><span class="WHIT">            </span><span class="NAME">itemsH</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="NAME">$items.outerHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">dlH</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$dl.outerHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>435</span> </span><span class="WHIT">            </span><span class="NAME">dltop</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$dl.offset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">top</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">top</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.element.data</span><span class="PUNC">(</span><span class="STRN">"dltop"</span><span class="PUNC">)</span><span class="PUNC">+</span><span class="NUMB">20</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>436</span> </span><span class="WHIT">        	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">dlH</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">20</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="PUNC">(</span><span class="NAME">top</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">dltop</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="NAME">dlH</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>437</span> </span><span class="WHIT">        		</span><span class="NAME">$dl.offset</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">top</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">dltop</span><span class="PUNC">+</span><span class="NAME">itemsH</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>438</span> </span><span class="WHIT">        		</span><span class="NAME">dltop</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$dl.offset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">top</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>439</span> </span><span class="WHIT">    		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>440</span> </span><span class="WHIT">        	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">dlH</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">itemsH</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>441</span> </span><span class="WHIT">        		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$up.is</span><span class="PUNC">(</span><span class="STRN">":hidden"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>442</span> </span><span class="WHIT">            		</span><span class="NAME">$items.outerHeight</span><span class="PUNC">(</span><span class="NAME">itemsH</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">$up.outerHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">*</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>443</span> </span><span class="WHIT">            		</span><span class="NAME">$up.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>444</span> </span><span class="WHIT">            		</span><span class="NAME">$down.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>445</span> </span><span class="WHIT">        		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>446</span> </span><span class="WHIT">        		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">dltop</span><span class="PUNC">></span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">dltop</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">itemsH</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>447</span> </span><span class="WHIT">            		</span><span class="NAME">$up.attr</span><span class="PUNC">(</span><span class="STRN">"disabled"</span><span class="PUNC">,</span><span class="STRN">"disabled"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">"om-itemselector-up-disabled"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>448</span> </span><span class="WHIT">            	</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>449</span> </span><span class="WHIT">            		</span><span class="NAME">$up.removeAttr</span><span class="PUNC">(</span><span class="STRN">"disabled"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">"om-itemselector-up-disabled"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>450</span> </span><span class="WHIT">            	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>451</span> </span><span class="WHIT">        		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">dltop</span><span class="WHIT"> </span><span class="PUNC">></span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="PUNC">(</span><span class="NAME">dlH</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">dltop</span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">top</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">></span><span class="PUNC">(</span><span class="NAME">itemsH</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>452</span> </span><span class="WHIT">        			</span><span class="NAME">$down.removeAttr</span><span class="PUNC">(</span><span class="STRN">"disabled"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">"om-itemselector-down-disabled"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>453</span> </span><span class="WHIT">        		</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>454</span> </span><span class="WHIT">        			</span><span class="NAME">$down.attr</span><span class="PUNC">(</span><span class="STRN">"disabled"</span><span class="PUNC">,</span><span class="STRN">"disabled"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">"om-itemselector-down-disabled"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>455</span> </span><span class="WHIT">        		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>456</span> </span><span class="WHIT">        	</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>457</span> </span><span class="WHIT">        		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$up.is</span><span class="PUNC">(</span><span class="STRN">":visible"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>458</span> </span><span class="WHIT">        			</span><span class="NAME">$items.outerHeight</span><span class="PUNC">(</span><span class="NAME">itemsH</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">$up.outerHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">*</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>459</span> </span><span class="WHIT">        			</span><span class="NAME">$up.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>460</span> </span><span class="WHIT">        			</span><span class="NAME">$down.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>461</span> </span><span class="WHIT">        		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>462</span> </span><span class="WHIT">        	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>463</span> </span><span class="WHIT">        	
<span class='line'>464</span>         </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>465</span> </span><span class="WHIT">        </span><span class="NAME">_getPageItems</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">panel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$dt</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>466</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">items</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">".om-itemselector-items"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">panel</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">itemsH</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">items.outerHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>467</span> </span><span class="WHIT">        	</span><span class="NAME">$dl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">">dl"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">items</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pageItems</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">hasPageButton</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">items.next</span><span class="PUNC">(</span><span class="STRN">":visible"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">></span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>468</span> </span><span class="WHIT">        	</span><span class="NAME">dtH</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$dt.outerHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">num</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">itemsH</span><span class="PUNC">/</span><span class="NAME">dtH</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">dltop</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$dl.offset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">top</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>469</span> </span><span class="WHIT">        	</span><span class="NAME">top</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.element.data</span><span class="PUNC">(</span><span class="STRN">"dltop"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>470</span> </span><span class="WHIT">            </span><span class="NAME">dltop</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hasPageButton</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">top</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">dltop</span><span class="PUNC">+</span><span class="NUMB">20</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">top</span><span class="PUNC">-</span><span class="NAME">dltop</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>471</span> </span><span class="WHIT">        		</span><span class="NAME">pageItems</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$.grep</span><span class="PUNC">(</span><span class="NAME">$dt</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">n</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>472</span> </span><span class="WHIT">        			</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">num</span><span class="PUNC">*</span><span class="PUNC">(</span><span class="NAME">dltop</span><span class="PUNC">/</span><span class="NAME">itemsH</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">num</span><span class="PUNC">*</span><span class="PUNC">(</span><span class="NAME">dltop</span><span class="PUNC">/</span><span class="NAME">itemsH</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>473</span> </span><span class="WHIT">        		</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>474</span> </span><span class="WHIT">        	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">pageItems</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>475</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>476</span> </span><span class="WHIT">        </span><span class="NAME">select</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">indexs</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>477</span> </span><span class="WHIT">        	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">$.isArray</span><span class="PUNC">(</span><span class="NAME">indexes</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>478</span> </span><span class="WHIT">                </span><span class="NAME">indexes</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="NAME">indexes</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>479</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>480</span> </span><span class="WHIT">            </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">indexs.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>481</span> </span><span class="WHIT">            	</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items>dl>dt[_index="'</span><span class="PUNC">+</span><span class="NAME">indexs</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">+</span><span class="STRN">'"]'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">"om-state-highlight"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>482</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>483</span> </span><span class="WHIT">        	
<span class='line'>484</span>         </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>485</span> </span><span class="WHIT">        </span><span class="NAME">_moveItemsToTarget</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">selector</span><span class="PUNC">,</span><span class="NAME">isLeftToRight</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>486</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fromPanel</span><span class="PUNC">=</span><span class="NAME">isLeftToRight</span><span class="PUNC">?</span><span class="NAME">this.leftPanel</span><span class="PUNC">:</span><span class="NAME">this.rightPanel</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>487</span> </span><span class="WHIT">                </span><span class="NAME">selectedItems</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items>dl>dt'</span><span class="PUNC">+</span><span class="NAME">selector</span><span class="PUNC">,</span><span class="NAME">fromPanel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>488</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">selectedItems.size</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">==</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>489</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>490</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">toPanel</span><span class="PUNC">=</span><span class="NAME">isLeftToRight</span><span class="PUNC">?</span><span class="NAME">this.rightPanel</span><span class="PUNC">:</span><span class="NAME">this.leftPanel</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>491</span> </span><span class="WHIT">                </span><span class="NAME">op</span><span class="PUNC">=</span><span class="NAME">this.options</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>492</span> </span><span class="WHIT">                </span><span class="NAME">itemData</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>493</span> </span><span class="WHIT">            </span><span class="NAME">selectedItems.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>494</span> </span><span class="WHIT">                </span><span class="NAME">itemData.push</span><span class="PUNC">(</span><span class="NAME">op.dataSource</span><span class="PUNC">[</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">'_index'</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>495</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>496</span> </span><span class="WHIT">            </span><span class="COMM">//先触发onBeforeItemSelect或onBeforeItemDeselect事件，然后移动并触发onItemSelect或onItemDeselect事件</span><span class="WHIT">
<span class='line'>497</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">isLeftToRight</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>498</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">self._trigger</span><span class="PUNC">(</span><span class="STRN">"onBeforeItemSelect"</span><span class="PUNC">,</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="NAME">itemData</span><span class="PUNC">)</span><span class="PUNC">===</span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>499</span> </span><span class="WHIT">                    </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>500</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>501</span> </span><span class="WHIT">                </span><span class="NAME">selectedItems.appendTo</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items>dl'</span><span class="PUNC">,</span><span class="NAME">toPanel</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">"om-state-highlight"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>502</span> </span><span class="WHIT">                
<span class='line'>503</span>                 </span><span class="NAME">self._trigger</span><span class="PUNC">(</span><span class="STRN">"onItemSelect"</span><span class="PUNC">,</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="NAME">itemData</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>504</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>505</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">self._trigger</span><span class="PUNC">(</span><span class="STRN">"onBeforeItemDeselect"</span><span class="PUNC">,</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="NAME">itemData</span><span class="PUNC">)</span><span class="PUNC">===</span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>506</span> </span><span class="WHIT">                    </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>507</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>508</span> </span><span class="WHIT">                </span><span class="NAME">selectedItems.appendTo</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items>dl'</span><span class="PUNC">,</span><span class="NAME">toPanel</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">"om-state-highlight"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>509</span> </span><span class="WHIT">                </span><span class="NAME">self._trigger</span><span class="PUNC">(</span><span class="STRN">"onItemDeselect"</span><span class="PUNC">,</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="NAME">itemData</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>510</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>511</span> </span><span class="WHIT">            </span><span class="NAME">self._refreshHeaderCheckbox</span><span class="PUNC">(</span><span class="NAME">fromPanel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>512</span> </span><span class="WHIT">            </span><span class="NAME">self._refreshPageButton</span><span class="PUNC">(</span><span class="NAME">fromPanel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>513</span> </span><span class="WHIT">            </span><span class="NAME">self._refreshPageButton</span><span class="PUNC">(</span><span class="NAME">toPanel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>514</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>515</span> </span><span class="WHIT">        
<span class='line'>516</span>         </span><span class="COMM">/**
<span class='line'>517</span>          * 得到或设置组件的value值。
<span class='line'>518</span>          * @function
<span class='line'>519</span>          * @name omItemSelector#value
<span class='line'>520</span>          * @param v 设置的值，不设置表示获取值
<span class='line'>521</span>          * @returns 如果没有参数时表示getValue()返回combo的value值，比如dataSource:[{text:'abc',value:true},{text:'def',value:2},{text:'xyz',value:'x'}]选择了第2条和第三条，则getValue返回[2,'x']。如果有参数时表示setValue(newValue)返回jQuery对象。
<span class='line'>522</span>          * 
<span class='line'>523</span>          */</span><span class="WHIT">
<span class='line'>524</span> </span><span class="WHIT">        </span><span class="NAME">value</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">newValue</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>525</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">arguments.length</span><span class="PUNC">==</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">//getValue</span><span class="WHIT">
<span class='line'>526</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">op</span><span class="PUNC">=</span><span class="NAME">this.options</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>527</span> </span><span class="WHIT">                    </span><span class="NAME">selectedItems</span><span class="PUNC">=</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-itemselector-items>dl>dt'</span><span class="PUNC">,</span><span class="NAME">this.rightPanel</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>528</span> </span><span class="WHIT">                    </span><span class="NAME">returnValue</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>529</span> </span><span class="WHIT">                </span><span class="NAME">selectedItems.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>530</span> </span><span class="WHIT">                    </span><span class="NAME">returnValue.push</span><span class="PUNC">(</span><span class="NAME">op.dataSource</span><span class="PUNC">[</span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">'_index'</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>531</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>532</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">returnValue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>533</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">//setValue</span><span class="WHIT">
<span class='line'>534</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$.isArray</span><span class="PUNC">(</span><span class="NAME">newValue</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>535</span> </span><span class="WHIT">                    </span><span class="NAME">this.options.value</span><span class="PUNC">=</span><span class="NAME">newValue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>536</span> </span><span class="WHIT">                    </span><span class="NAME">this._buildList</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>537</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>538</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>539</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>540</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>541</span> </span><span class="WHIT">    
<span class='line'>542</span>     </span><span class="NAME">$.om.lang.omItemSelector</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>543</span> </span><span class="WHIT">        </span><span class="NAME">availableTitle</span><span class="PUNC">:</span><span class="STRN">'可选项'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>544</span> </span><span class="WHIT">        </span><span class="NAME">selectedTitle</span><span class="PUNC">:</span><span class="STRN">'已选项'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>545</span> </span><span class="WHIT">        </span><span class="NAME">addIconTip</span><span class="PUNC">:</span><span class="STRN">'右移'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>546</span> </span><span class="WHIT">        </span><span class="NAME">removeIconTip</span><span class="PUNC">:</span><span class="STRN">'左移'</span><span class="WHIT">       
<span class='line'>547</span>     </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>548</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="NAME">jQuery</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>